package BSQX_Bit;


import java.util.*;


public class BSQX_4_5 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str1=new String();

        str1= scanner.nextLine();
        String[] strs=str1.split("-");
        /*感觉和手套问题一样,都是找长度短的,然后判断牌面大小
        * 在去长度较长的数据中得出结果*/
        char[] s1=strs[0].toCharArray();
        char[] s2=strs[1].toCharArray();
        char[] sss={'3','4','5','6','7','8','9','1','J','Q','K','A'};
        HashMap<Character,Integer> h1=new HashMap();
        HashMap<Character,Integer> h2=new HashMap();
        for (int i = 0; i < s1.length; i++) {
            char ch=s1[i];
           if (!h1.containsKey(ch)){
               h1.put(ch,1);
           }else {
               h1.put(ch,h1.get(ch)+1);
           }
        }

        for (int i = 0; i < s2.length; i++) {
            char ch=s2[i];
            if (!h2.containsKey(ch)){
                h2.put(ch,1);
            }else {
                h2.put(ch,h2.get(ch)+1);
            }
        }
        int sum1=0,sum2=0;
        for (int i = 0; i < sss.length; i++) {
            char ch=sss[i];
            if (h1.containsKey(ch)){
                int k=h1.get(ch);

            }
        }


    }




    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        /*不好意思理解错题意了*/
        int count=0;
        for (int i = 2; i <= n; i++) {
            int sum=1;
            for (int j = 2; j < i; j++) {
                if (i % j ==0){
                    sum+=j;
                }
            }
            if (sum == i){
                count++;
            }
        }
        System.out.println(count);
    }


}
